package com.apes.framework.rop.securityManager;

import com.apes.oap.security.AppSecretManager;

import java.util.HashMap;
import java.util.Map;

public class SampleAppSecretManager implements AppSecretManager {
    private static Map<String, String> appKeySecretMap = new HashMap<>();

    static {
        appKeySecretMap.put("00001", "abcdeabcdeabcdeabcdeabcde");
        appKeySecretMap.put("00002", "abcdeabcdeabcdeabcdeaaaaa");
        appKeySecretMap.put("00003", "abcdeabcdeabcdeabcdeaaaaa");
        appKeySecretMap.put("00004", "abcdeabcdeabcdeabcdeabdcd");
    }


    public String getSecret(String appKey) {
        return appKeySecretMap.get(appKey);
    }


    public boolean isValidAppKey(String appKey) {
        return getSecret(appKey) != null;
    }
}

